<template>
  <div>
    <page-layout
      :title="projectInfo.projectName"
      logo="https://gw.alipayobjects.com/zos/rmsportal/nxkuOJlFJuAUhzlMTCEe.png"
    >
      <a-card style="margin-top: 24px" :bordered="true" title="标段进程">
        <a-steps :direction="(isMobile() && 'vertical') || 'horizontal'" :current="1" progressDot>
          <a-step title="创建项目"> </a-step>
          <a-step title="部门初审"> </a-step>
          <a-step title="财务复核"> </a-step>
          <a-step title="完成"> </a-step>
        </a-steps>
      </a-card>
      <a-card style="margin-top: 24px" :bordered="true" title="项目信息">
        <detail-list size="medium" :col="2" class="detail-layout">
          <detail-list-item term="招投标名称"
            ><a-tag color="red">
              {{ projectInfo.tenderProjectName }}
            </a-tag></detail-list-item
          >
          <detail-list-item term="是否扶贫项目">
            <a-tag v-if="projectInfo.povertyReliefProject == '1'" color="#2db7f5"> 是 </a-tag>
            <a-tag v-else color="#108ee9"> 否 </a-tag>
          </detail-list-item>
          <detail-list-item term="公共资源交易类型">{{ projectInfo.publicResourceType }}</detail-list-item>
          <detail-list-item term="工程专业类型">{{ projectInfo.engineeringMajorType }}</detail-list-item>
          <detail-list-item term="入场登记部门">{{ projectInfo.admissionDepartment }}</detail-list-item>
          <detail-list-item term="项目行政主管地区">{{ projectInfo.projectAdministrationArea }}</detail-list-item>
          <detail-list-item term="行业主管部门">{{ projectInfo.industryAuthorities }}</detail-list-item>
          <detail-list-item term="行管部门审批备案编号">{{ projectInfo.managementDeptno }}</detail-list-item>
          <detail-list-item term="主体建设单位">{{ projectInfo.mainConstructionUnit }}</detail-list-item>
          <detail-list-item term="组织机构代码/统一社会信用代码"
            ><a-tag color="#87d068">
              {{ projectInfo.organNo }}
            </a-tag></detail-list-item
          >
          <detail-list-item term="单位负责人">{{ projectInfo.unitResponsiblePerson }}</detail-list-item>
          <detail-list-item term="办公电话">{{ projectInfo.phone }}</detail-list-item>
          <detail-list-item term="移动电话">{{ projectInfo.mobile }}</detail-list-item>
          <detail-list-item term="项目来源">{{ projectInfo.projectSource }}</detail-list-item>
          <detail-list-item term="入库时间">{{ projectInfo.version }}</detail-list-item>
          <detail-list-item term="交易平台编号">{{ projectInfo.jyptBh }}</detail-list-item>
        </detail-list>
      </a-card>

      <a-card style="margin-top: 24px" :bordered="false" title="招标信息">
        <detail-list size="medium" :col="2" class="detail-layout">
          <detail-list-item term="招投标名称"
            ><a-tag color="red">
              {{ projectInfo.tenderProjectName }}
            </a-tag></detail-list-item
          >
          <detail-list-item term="招标项目编号">{{ projectInfo.tenderProjectCode }}</detail-list-item>
          <detail-list-item term="招标方式">{{ projectInfo.biddingMethod }}</detail-list-item>
          <detail-list-item term="资审方式">{{ projectInfo.prequalificationMethod }}</detail-list-item>
          <detail-list-item term="递交投标文件方式">{{ projectInfo.tenderDocumentsMethod }}</detail-list-item>
          <detail-list-item term="招标组织形式">{{ projectInfo.tenderOrganizeForm }}</detail-list-item>
          <detail-list-item term="招标代理机构名称">{{ projectInfo.tenderAgencyName }}</detail-list-item>
          <detail-list-item term="招标代理组织机构代码/统一社会信用代码">
            <a-tag color="#87d068">
              {{ projectInfo.tenderAgencyCode }}
            </a-tag>
          </detail-list-item>
          <detail-list-item term="招标负责人">{{ projectInfo.tendererName }}</detail-list-item>
          <detail-list-item term="招标负责人办公电话">{{ projectInfo.tendererPhone }}</detail-list-item>
        </detail-list>
      </a-card>
      <!-- actions -->
      <template slot="action">
        <a-button-group style="margin-right: 4px">
          <a-button type="primary">申请保函</a-button>
          <a-button type="danger">缴费</a-button>
          <a-button type="primary " icon="download">下载保函</a-button>
         
        </a-button-group>
        <!-- <a-button type="primary">主操作</a-button> -->
      </template>
    </page-layout>
  </div>
</template>

<script>
import { mixinDevice } from '@/utils/mixin.js'
import PageLayout from '@/components/page/PageLayout'
import DetailList from '@/components/tools/DetailList'
import { getFinanTenderInfoByTenderProjectGuid, queryById } from '@/api/tenderInfo'
import SelectBank from './modules/selectBank.vue'

const DetailListItem = DetailList.Item

export default {
  name: 'FinanProjectInfoDetail',
  components: {
    PageLayout,
    DetailList,
    DetailListItem,
    SelectBank,
  },
  mixins: [mixinDevice],
  data() {
    return {
      guid: '',
      tenderInfoColumns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        // {
        //   title:'主键',
        //   align:"center",
        //   dataIndex: 'guid'
        // },
        {
          title: '标段编号',
          align: 'center',
          dataIndex: 'bidSectionCode',
        },
        {
          title: '标段名称',
          align: 'center',
          dataIndex: 'bidSectionName',
        },
        {
          title: '招标项目编号',
          align: 'center',
          dataIndex: 'tenderProjectCode',
        },
        {
          title: '项目名称',
          align: 'center',
          dataIndex: 'projectName',
        },
        {
          title: '公共资源交易类型',
          align: 'center',
          dataIndex: 'publicResourceType',
        },
        {
          title: '主体建设单位',
          align: 'center',
          dataIndex: 'mainConstructionUnit',
        },
        {
          title: '组织机构代码/统一社会信用代码',
          align: 'center',
          dataIndex: 'organNo',
        },
        // {
        //   title:'招标项目主键',
        //   align:"center",
        //   dataIndex: 'tenderProjectGuid'
        // },
        {
          title: '标段分类',
          align: 'center',
          dataIndex: 'sectionType',
        },
        {
          title: '标段合同估算价（万元）',
          align: 'center',
          dataIndex: 'contractPrice',
        },
        {
          title: '投标保证金金额（万元）',
          align: 'center',
          dataIndex: 'bidBond',
        },
        {
          title: '投标保证金缴纳方式',
          align: 'center',
          dataIndex: 'bondPayType',
        },
        {
          title: '投标保证金账号',
          align: 'center',
          dataIndex: 'bondAccount',
        },
        {
          title: '开户行',
          align: 'center',
          dataIndex: 'bank',
        },
        {
          title: '户名',
          align: 'center',
          dataIndex: 'accountName',
        },
        {
          title: '是否退还利息',
          align: 'center',
          dataIndex: 'isBakBond',
        },
        {
          title: '投标保证金截止时间',
          align: 'center',
          dataIndex: 'bidBondEndtime',
        },
        {
          title: '入库时间',
          align: 'center',
          dataIndex: 'version',
        },
        {
          title: '招标内容',
          align: 'center',
          dataIndex: 'tendererContent',
        },
        {
          title: '评标方式',
          align: 'center',
          dataIndex: 'bidEvaluationMethod',
        },
        {
          title: '项目资质要求',
          align: 'center',
          dataIndex: 'projectQualification',
        },
        {
          title: '项目经理（总监）专业',
          align: 'center',
          dataIndex: 'projectManagerMajor',
        },
        {
          title: '项目经理（总监）最低资格等级',
          align: 'center',
          dataIndex: 'projectManagerMinQualification',
        },
        {
          title: '工程专业类型',
          align: 'center',
          dataIndex: 'engineeringMajorType',
        },
        {
          title: '标段状态', //（1.正常、2.流标、3.暂停、4.终止）
          align: 'center',
          dataIndex: 'sectionStatus',
        },
        {
          title: '行政区划代码',
          align: 'center',
          dataIndex: 'areaCode',
        },
        {
          title: '交易平台编号',
          align: 'center',
          dataIndex: 'jyptBh',
        },
        // {
        //   title:'逻辑删除字段',
        //   align:"center",
        //   dataIndex: 'isdeleted'
        // },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          fixed: 'right',
          width: 147,
          scopedSlots: { customRender: 'action' },
        },
      ],
      tenderInfoDataSource: [],
      tenderInfoQuery: {
        tenderProjectGuid: '',
      },
      projectInfo: {
        admissionDepartment: '',
        areaCode: '',
        biddingMethod: '',
        engineeringMajorType: '',
        guid: '',
        industryAuthorities: '',
        jyptBh: '',
        mainConstructionUnit: '',
        managementDeptno: '',
        mobile: '',
        organNo: '',
        phone: '',
        povertyReliefProject: '',
        prequalificationMethod: '',
        projectAdministrationArea: '',
        projectName: '',
        projectSource: '',
        projectType: '',
        publicResourceType: '',
        tenderAgencyCode: '',
        tenderAgencyName: '',
        tenderDocumentsMethod: '',
        tenderOrganizeForm: '',
        tenderProjectCode: '',
        tenderProjectName: '',
        tendererMobile: '',
        tendererName: '',
        tendererPhone: '',
        unitResponsiblePerson: '',
        version: '',
      },
    }
  },
  methods: {
    getFinanTenderInfoByTenderProjectGuid() {
      getFinanTenderInfoByTenderProjectGuid(this.tenderInfoQuery).then((res) => {
        this.tenderInfoDataSource = res.result
      })
    },
    selectBank(record) {
      this.$refs.modal.edit(record)
    },
    queryById() {
      queryById({ id: this.tenderInfoQuery.tenderProjectGuid }).then((res) => {
        this.projectInfo = res.result
        console.log(res.result)
      })
    },
  },
  created() {
    this.tenderInfoQuery.tenderProjectGuid = this.$route.query.id
    this.getFinanTenderInfoByTenderProjectGuid()
    this.queryById()
  },
}
</script>

<style lang="less" scoped>
.detail-layout {
  margin-left: 44px;
}
.text {
  color: rgba(0, 0, 0, 0.45);
}

.heading {
  color: rgba(0, 0, 0, 0.85);
  font-size: 20px;
}

.no-data {
  color: rgba(0, 0, 0, 0.25);
  text-align: center;
  line-height: 64px;
  font-size: 16px;

  i {
    font-size: 24px;
    margin-right: 16px;
    position: relative;
    top: 3px;
  }
}

.mobile {
  .detail-layout {
    margin-left: unset;
  }
  .text {
  }
  .status-list {
    text-align: left;
  }
}
</style>